php forum
php mysql forum
php mysql smarty
 
Topic Options
#315996 - 10/12/07 05:54 PM [7.2.2] Help...Make PM HTML enabled.
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
I want my PM HTML enabled (for all users) , is it possible ?
What scripts should I modified ?

Is it function doPreview() of ubb_jslib.js ?
How should I modify it ?

This is the most important function my site required.
If not solved , I have to stay with UBB6.5.
Can anybody help me , very thanks....


Edited by smallufo (10/12/07 05:55 PM)

Top
#316001 - 10/15/07 03:34 AM Re: [7.2.2] Help...Make PM HTML enabled. [Re: smallufo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
If you want to set it so all PM's proces both html and ubbcode, change this line in /scripts/sendmessage.inc.php

Code:
	$Message = $html -> do_markup($Message,"post","markup");


with
Code:
	$Message = $html -> do_markup($Message,"post","both");


This not handle preview correctly yet.

All in all, there is no need to fiddle around in javascript whatsoever, it's mostly stuff that calls php scripts for the actual work.


Edited by blaaskaak (10/15/07 03:40 AM)
_________________________

Top
#316003 - 10/15/07 05:34 AM Re: [7.2.2] Help...Make PM HTML enabled. [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
Hi , thanks
But I still need HTML enabled in preview.

Top
#316004 - 10/15/07 06:16 AM Re: [7.2.2] Help...Make PM HTML enabled. [Re: smallufo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Okay. Do you allow html forumwide or just in PM's?

And if so, do you want users to be able to toggle whether or not to use html?
_________________________

Top
#316006 - 10/15/07 08:49 AM Re: [7.2.2] Help...Make PM HTML enabled. [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
HTML enabled/disabled is based on forum option.
The forum doesn't need to be changed.

I want HTML enabled (including preview) for everyone in PM.

Top
#316007 - 10/15/07 10:20 AM Re: [7.2.2] Help...Make PM HTML enabled. [Re: smallufo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Okay done!

The thing I said to edit in /scripts/sendmessage.inc.php, do the same for /scripts/mess_reply.inc.php

This will make sure both html and ubb code markup is available in all PM's.

You also need to edit 3 templates for the preview to work:

You need to add this line:
Code:
<input type="hidden" name="convert" value="both" />


to
/templates/default/viewmessage.tpl
after
Code:
<input type="hidden" name="ubb" value="mess_reply" />


/templates/default/mess_handler.tpl
after
Code:
<input type="hidden" name="ubb" value="mess_reply" />


/templates/default/sendprivate.tpl
after
Code:
<input type="hidden" name="ubb" value="sendmessage" />


These edits adds the variable convert to the forms, which tells the preview engine how to markup the message.

Let me know if it works please!


Edited by blaaskaak (10/15/07 10:29 AM)
_________________________

Top
#316009 - 10/15/07 01:40 PM It WORKS , thank you very much.... [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
It works , thank you very much.
I don't know how to express my appreciation. You helped me a lot.
Now I can finally grade to UBB7.

Top
#316010 - 10/15/07 01:44 PM Re: It WORKS , thank you very much.... [Re: smallufo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
We might be a bit slow sometimes here, but we get the job done laugh

So you are very welcome. Luckely the hack is so simple, that it is very easy to implement in new versions again if you upgrade again the future.


Edited by blaaskaak (10/15/07 01:53 PM)
_________________________

Top
#316101 - 10/23/07 12:06 PM Re: It WORKS , thank you very much.... [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
Hi , I found the "replier" still cannot correctly preview HTML when they reply.
No matter Quick Reply or Full Reply Screen , the Preview screen cannot correctly display HTML.
But the sent message can display correct HTML.

Which parts should I modify now ?

Top
#316102 - 10/23/07 03:37 PM Re: It WORKS , thank you very much.... [Re: smallufo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Is that both from the quick reply and the actual reply screen?
_________________________

Top
#316111 - 10/23/07 06:51 PM Re: It WORKS , thank you very much.... [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: blaaskaak
Is that both from the quick reply and the actual reply screen?


Ehr, forget me asking, you already gave the answer. It's around 2 am here now, so I can't look into it anymore tonight, but I'll get back to you about this tomorrow.

If you give me your board url (you could PM me if you want to keep it private) I could take a look at your forum to see what's going wrong.
_________________________

Top
#316117 - 10/24/07 05:13 AM Re: It WORKS , thank you very much.... [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
Hi
The server is located in intranet , not connectable from internet.
It's my test platform , to ensure everything works.
If everything works fine , I'll deploy to internet site.


Top
#316195 - 10/31/07 04:29 PM Re: It WORKS , thank you very much.... [Re: blaaskaak]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
I look into the Quick Reply form , found there has been a hidden field :
input type="hidden" name="convert" value="both"
But why it still cannot preview HTML ...
URL is : ubbthreads.php?ubb=viewmessage&message=266324&gonew=0
The source code is :
Code:
<form method="post" action="/ubbthreads722/ubbthreads.php" name="replier">
<br />
<br />
</td>
<td class="alt-1" width="83%">
<input type="hidden" name="ubb" value="mess_reply" />
<input type="hidden" name="convert" value="both" />
<input type="hidden" name="Number" value="266324" />
<input type="hidden" name="Parent" value="266324" />
<input type="hidden" name="id" value="266328" />
<input type="hidden" name="quickreply" value="1" />
<textarea cols="65" rows="10" class="form-input" name="Body"></textarea>
<br />
<input type="submit" name="textcont" value="Submit" class="form-button" />
<input type="button" name="textcont" value="Preview Reply" class="form-button" onclick="doPreview();" />
<input type="button" name="textcont" value="Switch to Full Reply Screen" class="form-button" onclick="switchAdvanced('pt');" />
</form>
</td>

</tr>
</table>
</td>
</tr>
</table>


<div id="preview_area" style="display: none;">
<table width="100%" class="t_outer" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" class="t_inner" cellpadding="0" cellspacing="1">
<tr>
<td class="tdheader">
Preview
</td>
</tr>

<tr>
<td class="alt-1">
<span id="preview_text">
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>

Top
#316196 - 10/31/07 05:03 PM Re: It WORKS , thank you very much.... [Re: smallufo]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
ok , I found where goes wrong.
Because of previewpost.inc.php's limitation , it only allows Admin to pewview HTML .
After I comment out the four lines below , every user can preview HTML :
Code:
//      if ($user['USER_MEMBERSHIP_LEVEL'] == "User") {
//              if (($convert == "both" || $convert == "html") && $HTML != 1) {
//                      $convert = "none";
//              } // end if
//      } // end if


Why UBBThreads set this limitation ?

Top
#316198 - 10/31/07 05:38 PM Re: It WORKS , thank you very much.... [Re: smallufo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
You'd have to ask rick, but I'm sure it's for security, as allowing HTML allows people to embed anything they want, including code which can steal user cookies or replace all of your images on that page with non-appropriate images...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#316199 - 10/31/07 06:34 PM Re: It WORKS , thank you very much.... [Re: Gizmo]
smallufo Offline
Journeyman

Registered: 05/11/99
Posts: 110
Loc: Taiwan
well , I think ubbthreads should incorporate a more fine-grained HTML control mechanism .
Such as only allow A TABLE TH/TR/TD FONT "Safer" tags and disallow SCRIPT IMG EMBED OBJECT ...etc.
Maybe it can depend on the user role , allowing which role can use which tags ...etc.

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks